﻿Option Strict On
Option Explicit On

Imports System
Imports System.Data
Imports System.Data.SqlClient

Namespace Framework
    Public Enum Flag
        eng_us
        eng_uk
        thai
        japan
    End Enum

    Public Enum Events
        Load
        News
        Edit
        Delete
        Save
        Cancel
        Print
        Close
    End Enum

    Public Module PermissionData
        Public OWNER_ID As String = ""
        Public OWNER_NAMETH As String = ""
        Public OWNER_NAMEEN As String = ""

        Public EMPLOYEE_ID As Integer = 0
        Public EMPLOYEE_FIRSTNAME As String
        Public EMPLOYEE_LASTNAME As String

        Public USER_ID As String = ""
        Public USER_NAMETH As String = ""
        Public USER_NAMEEN As String = ""
        Public USER_PASSWORD As String = ""
        Public USER_LEVEL As Integer = 0

        Public PERMISSION_ONE As Integer = 0
        Public PERMISSION_TWO As Integer = 0
        Public PERMISSION_TREE As Integer = 0
        Public PERMISSION_FORTH As Integer = 0
        Public PERMISSION_FIFTH As Integer = 0
        Public PERMISSION_SIX As Integer = 0
        Public PERMISSION_SEVEN As Integer = 0
        Public PERMISSION_EIGHT As Integer = 0
        Public PERMISSION_NINE As Integer = 0
        Public PERMISSION_TAN As Integer = 0
        Public PERMISSION_ELEVEN As Integer = 0
        Public PERMISSION_TWELVE As Integer = 0

        Public SITE_ID As Integer = 0
        Public SITE_CODE As String = ""
        Public SITE_NAME As String = ""


        '---------------Traffic Config ----------------
        Public F_Map_Path_Server As String = Configuration.ConfigurationManager.AppSettings("Map_Path_Server") 'path เก็บแผนที่

        Public F_UserID_STR As String = Configuration.ConfigurationManager.AppSettings("USER_ID")
        Public F_Password_STR As String = Configuration.ConfigurationManager.AppSettings("PASSWORD")
        Public F_ServerName_STR As String = Configuration.ConfigurationManager.AppSettings("SERVER_NAME")
        Public F_DatabaseName_STR As String = Configuration.ConfigurationManager.AppSettings("DATABASE_NAME")
        Public F_PrinterName_STR As String = Configuration.ConfigurationManager.AppSettings("PRINTER_NAME")
        Public F_PrinterName_STR1 As String = Configuration.ConfigurationManager.AppSettings("PRINTER_NAME1")

        Public F_StoreName As String
        Public F_DataTable As Data.DataTable
        Public F_Para_Name(9) As String
        Public F_SqlDbType(9) As Data.SqlDbType
        Public F_Para_Number(9) As Integer
        Public F_Para_Value(9) As Object
        Public F_Index As Integer = 0

        Public F_Username_Str As String = ""
        Public F_EMPLOYEE_FNAME As String = ""
        Public F_EMPLOYEE_LNAME As String = ""
        Public F_EMPLOYEE_CODE As String = ""
        Public F_DEPART_CODE As String = ""
        Public F_APPROVE_CODE As String = ""       ' เก็บ ApproveCode
        Public flagcheckTimeStop As Boolean = False
        Public F_RECEIPT_MESSAGE As Integer = 0
        Public F_GROUP_NAME As String = "" 'เก็บชื่อแผนกว่าเป็น Sale หรือไม่  

        Public F_CUST_CODE_STR As String = ""
        Public F_CUST_SHORTNAME_STR As String = ""
        Public F_CUST_NAME_TH_STR As String = ""
        Public F_CUST_NAME_EN_STR As String = ""

        Public F_tmpCheckListView_INT As Integer = 0
        Public F_ArrayData_STR(10) As String
        Public F_ArrayNameToListView_Str(10) As String
        Public F_ArraySizeToListView_Int(10) As Integer
        Public F_ArrayNameToComboBox_Str(10) As String

        'MAIL SERVER

        Public F_Email_SMTP As String = Configuration.ConfigurationManager.AppSettings("EMAIL_SMTP") '
        Public F_Email_UserName As String = Configuration.ConfigurationManager.AppSettings("EMAIL_USERNAME") '
        Public F_Email_Password As String = Configuration.ConfigurationManager.AppSettings("EMAIL_PASSWORD") '
        'Public F_Email_SMTP As String = Configuration.ConfigurationManager.AppSettings("mail.wice.co.th") '
        'Public F_Email_UserName As String = Configuration.ConfigurationManager.AppSettings("tochihara@wice.co.th") '
        'Public F_Email_Password As String = Configuration.ConfigurationManager.AppSettings("fgtwice230") '
        Public F_FIELD_COUNT As String = Configuration.ConfigurationManager.AppSettings("FIELD_COUNT")

        '  Public F_DateTime As String = Framework.CLASSDATE.GETDATEATSERVER.ToString("dd MMM yyyy h:mm:ss tt") 'GETDATEATSERVER.ToString("dd MMM yyyy h:mm:ss tt")
    End Module

    Public Module MessageENTH
        '---------------------------- ข้อความหน้าจอบันทึก --------------------------------
        Public Save_Text() As String = {"Do you want to save this data?", "คุณต้องการบันทึกรายการนี้หรือไม่?"}
        Public Save_Caption() As String = {"Saving...", "บันทึก..."}
        Public Saved_Text() As String = {"Save is completed.", "บันทึกเรียบร้อยแล้ว"}
        Public Saved_Caption() As String = {"Completed...", "เรียบร้อย..."}
        '----------------------------------------------------------------------------

        '------------------------------ ข้อความหน้าจอลบ ---------------------------------
        Public Delete_Text() As String = {"Do you want to delete this data?", "คุณต้องการลบข้อมูลนี้หรือไม่?"}
        Public Delete_Caption() As String = {"Delete...", "ลบ..."}
        Public Deleted_Text() As String = {"Delete is completed.", "ลบเรีบยร้อยแล้ว"}
        Public Deleted_Caption() As String = {"Completed...", "เรียบร้อย..."}
        '----------------------------------------------------------------------------

        '---------------------------- ข้อความหน้าจอบันทึก --------------------------------
        Public Select_Text() As String = {"Please select data record.", "กรุณาเลือกรายการก่อน"}
        Public Select_Caption() As String = {"Warning...", "คำเตือน..."}
        '----------------------------------------------------------------------------

        Public Error_Tran_Text() As String = {"Something is problem. Please try again.", "ไม่สามารถทำรายการต่อไปได้เนื่องจากมีบางข้อมูลไม่ถูกต้อง"}
        Public Error_Tran_Caption() As String = {"Warning...", "คำเตือน..."}

        Public Enter_Text() As String = {"Please enter character.", "กรุณากรอกข้อมูลก่อน"}
        Public Enter_Caption() As String = {"Error...", "คำเตือน..."}

        Public Select_Langauge As Flag = Flag.thai
        Public Overloads Function LangaugeInt() As Integer
            If Select_Langauge = Flag.eng_us Then
                Return 0
            Else
                Return 1
            End If
        End Function

        Public Overloads Function LangaugeStr() As String
            Select Case Select_Langauge
                Case Flag.eng_us
                    Return "en"
                Case Flag.eng_uk
                    Return "en"
                Case Flag.japan
                    Return "ja"
                Case Flag.thai
                    Return "th"
            End Select
        End Function
    End Module
End Namespace